import React,{ Component } from 'react';
import { connect } from 'react-redux'
import './index.scss';
import TopPart from './topPart';
import { loginDataAction } from '../../actions/header';
import 'antd/dist/antd.css'

class Header extends Component{

    render(){
        return (
            <div className='header-wrapper'>
                <TopPart loginData={this.props.loginData}  loginDataFunc={this.props.loginDataFunc} />
            </div>
        )
    }
}


const mapStateToProps = (state,ownProps)=>{
    return {
        loginData:state.loginDataReducer.data||{},
    }
};

const mapDispatchToProps=(dispatch,ownProps)=>{
    return {
        loginDataFunc:(data)=>{
            dispatch(loginDataAction(data))
        }
    }
};

export default connect(mapStateToProps,mapDispatchToProps)(Header)
